package com.ch.home.bean;

/**
 * 游戏题库
 * Created by CHEN on 2019/8/23.
 */
public class GameRepository {

    private Integer questionId;
    private String questionUrl;
    private String questionContent;
    private String option1;
    private String option2;
    private String answer;

    public GameRepository() {
    }

    public GameRepository(Integer questionId, String questionUrl, String questionContent, String option1, String option2, String answer) {
        this.questionId = questionId;
        this.questionUrl = questionUrl;
        this.questionContent = questionContent;
        this.option1 = option1;
        this.option2 = option2;
        this.answer = answer;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass( ) != o.getClass( )) return false;

        GameRepository that = (GameRepository) o;

        if (questionId != null ? !questionId.equals(that.questionId) : that.questionId != null) return false;
        if (questionUrl != null ? !questionUrl.equals(that.questionUrl) : that.questionUrl != null) return false;
        if (questionContent != null ? !questionContent.equals(that.questionContent) : that.questionContent != null)
            return false;
        if (option1 != null ? !option1.equals(that.option1) : that.option1 != null) return false;
        if (option2 != null ? !option2.equals(that.option2) : that.option2 != null) return false;
        return answer != null ? answer.equals(that.answer) : that.answer == null;
    }

    @Override
    public int hashCode() {
        int result = questionId != null ? questionId.hashCode( ) : 0;
        result = 31 * result + (questionUrl != null ? questionUrl.hashCode( ) : 0);
        result = 31 * result + (questionContent != null ? questionContent.hashCode( ) : 0);
        result = 31 * result + (option1 != null ? option1.hashCode( ) : 0);
        result = 31 * result + (option2 != null ? option2.hashCode( ) : 0);
        result = 31 * result + (answer != null ? answer.hashCode( ) : 0);
        return result;
    }

    @Override
    public String toString() {
        return "GameRepository{" +
                "questionId=" + questionId +
                ", questionUrl='" + questionUrl + '\'' +
                ", questionContent='" + questionContent + '\'' +
                ", option1='" + option1 + '\'' +
                ", option2='" + option2 + '\'' +
                ", answer='" + answer + '\'' +
                '}';
    }

    public Integer getQuestionId() {
        return questionId;
    }

    public void setQuestionId(Integer questionId) {
        this.questionId = questionId;
    }

    public String getQuestionUrl() {
        return questionUrl;
    }

    public void setQuestionUrl(String questionUrl) {
        this.questionUrl = questionUrl;
    }

    public String getQuestionContent() {
        return questionContent;
    }

    public void setQuestionContent(String questionContent) {
        this.questionContent = questionContent;
    }

    public String getOption1() {
        return option1;
    }

    public void setOption1(String option1) {
        this.option1 = option1;
    }

    public String getOption2() {
        return option2;
    }

    public void setOption2(String option2) {
        this.option2 = option2;
    }

    public String getAnswer() {
        return answer;
    }

    public void setAnswer(String answer) {
        this.answer = answer;
    }
}
